import React from 'react';
class Product extends React.Component{
    constructor() {
        super();
        this.handleVote=this.handleVote.bind(this);
    }
    handleVote(){
        console.log("handleVote.........");
        this.props.onVote(this.props.id)

    }
    componentDidMount() {
    }

    render() {
        return(<div className="ui item" >
            <div onClick={this.handleVote}>
                <p>点赞：{this.props.votes}</p>
            </div>
            <div className="image">
                <img src={this.props.imageUrl} ></img>
            </div>
            <div>
                <div className="middle">
                    <p>{this.props.title}</p>
                </div>
            </div>
        </div>)
    }
}

export default Product;